package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.UserDto;
import com.zzyl.service.UserService;
import com.zzyl.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
   @Autowired
   private UserService userService;
    @PostMapping("/page/{pageNum}/{pageSize}")
    public ResponseResult selectByPage(
            @RequestBody UserDto userDto,
            @PathVariable("pageNum")  int pageNum,
            @PathVariable("pageSize")  int pageSize
    ){
              PageResponse<UserVo> pageResponse =userService.selectByPage(userDto,pageNum,pageSize);
              return  ResponseResult.success(pageResponse);
    }
}
